import { useEffect, useState } from 'react';

export function useWatchEffect(callBack: () => void, dep?: Array<any> | undefined): void {

    const [status, setStatus] = useState<boolean>(false);

    useEffect(() => {
        if (status) {
            callBack?.();
        } else {
            setStatus(true)
        }
    }, dep)

}